<template>
  <view class="hot-panel">
    <view class="hot-item" v-for="item in list" :key="item.id">
      <view class="hot-title-container">
        <text class="hot-title">{{item.title}}</text>
        <text class="hot-title-desc ellipsis" :title="item.alt">{{item.alt}}</text>
      </view>
      <view >
        <navigator class="hot-img-container"
          :url="`/pages/hot/index?type=${item.type}`"
          open-type="navigate"
          hover-class="navigator-hover"
        >
          <image
            v-for="subItem in item.pictures" :key="subItem"
              :src="subItem"
              mode="scaleToFill"
            />  
        </navigator>
      
     
      </view>
    </view>
  </view>
</template>

<script setup lang="ts">
import type { HotItem } from '@/types/home'

const props = defineProps<{
  list:HotItem[]
}>()
</script>

<style lang="scss" scoped>
.hot-panel{
  display: flex;
  flex-wrap: wrap;
  margin:0rpx 20rpx;
  // padding: 20rpx 25rpx;
  background: #fff;
  border-radius: 20rpx;

  .hot-item{
    width: 50%;
    border-top: 1px solid #eee;
    border-right: 1px solid #eee;
    padding: 16rpx 20rpx;

    &:nth-child(2n){
      border-right: none;
    }
    &:nth-child(-n +2){
      border-top: none;
    }
  }
  .hot-title-container{
    display: flex;
    align-items: center;
    .hot-title{
      font-size: 32rpx;
      color: #262626;
      min-width: 140rpx;
    }
    .hot-title-desc{
      font-size: 24rpx;
      color: #7f7f7f; 
      margin-left: 18rpx;
    }
  }
  .hot-img-container{
    display: flex;
    justify-content: space-between;
    align-items: center;
    image{
      width: 150rpx;
      height: 150rpx;
      // margin:0 10rpx;600+80 750
    }
  }
}
</style>
